package com.u.social.article.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import org.springframework.data.elasticsearch.annotations.*;

import java.io.Serializable;
import java.util.List;


/**
 * @program: u-social
 * @description: 帖子索引
 * @author: Alex Wu
 * @createDate: 2025-03-03 16:34
 **/

@Data
@Document(indexName = "article_index", createIndex = false)
public class ArticleIndex implements Serializable {
    private static final long serialVersionUID = 1L;

    @Field(type= FieldType.Long)
    private Long id;

    @MultiField(mainField = @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart"), otherFields = {
            @InnerField(type = FieldType.Keyword, suffix = "keyword") })
    private String title;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private String content;

    @Field(type = FieldType.Text, analyzer = "ik_max_word")
    private List topics;

    @Field(type= FieldType.Long)
    private Long likeCount;

}
